package com.controller;

import com.anno.FrontLogin;
import com.bugs.pojo.InfoTypeOption;
import com.controller.base.BaseController;
import com.controller.base.Response;
import com.model.JobInfo;
import com.service.JobInfoService;
import com.utils.from.FrontJobInfoListForm;
import com.utils.pojo.vo.FrontJobInfoVO;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("frontJobInfo")
public class FrontJobInfoController extends BaseController {

    @Resource
    private JobInfoService jobInfoService;

    @FrontLogin
    @PostMapping("/list")
    public List<FrontJobInfoVO> front_list(FrontJobInfoListForm form) {
        List<FrontJobInfoVO> result = jobInfoService.front_list(form);
        return result;
    }

    @FrontLogin
    @PostMapping("/getOption")
    public Response getOption() {
        Map result = new LinkedHashMap<>(1);
        //result.put("spiders", SpiderOption.getOptions());
        result.put("types", InfoTypeOption.getOptions());
        return success(result);
    }

}
